package com.bestcem.xm.componet.sms.aliyun.service;

import com.bestcem.xm.componet.sms.SmsService;
import com.bestcem.xm.componet.sms.aliyun.core.AliyunSmsClient;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

/**
 * @ClassName: AliyunSmsService
 * @Description:
 * @Author: chenglong.yue
 * @Date: 2023/5/16 18:28
 */
@Service
@Slf4j
@RequiredArgsConstructor
@ConditionalOnProperty(prefix = "sms", name = "smsType", havingValue = "aliyun")
public class AliyunSmsService implements SmsService, InitializingBean {

    //自己需要哪个调用哪个方法
    private final AliyunSmsClient smsClient;

    @Override
    public Map<String, Object> sendSms(String mobile, String content, Map<String, Object> keywards) {
        return new HashMap<>();
    }

    @Override
    public void afterPropertiesSet() {
        log.error("AliyunSmsService 实例化完成");
    }
}
